/**
 * @file _axiom-base-sheet.scss
 * @description 移动端底部弹窗基础样式，用于统一选择、筛选等组件
 */

@use '../../../styles/variables' as *;

%axiom-base-sheet {
  background: var(--axiom-base-sheet-bg-color);
  backdrop-filter: var(--axiom-base-sheet-backdrop-filter);
  border-top-left-radius: var(--axiom-base-sheet-border-radius);
  border-top-right-radius: var(--axiom-base-sheet-border-radius);
  display: flex;
  flex-direction: column;
  box-shadow: var(--axiom-base-sheet-box-shadow);
  border: 1px solid var(--axiom-base-sheet-border-color);
  border-bottom: none;
  position: relative;
  overflow: hidden;

  // 顶部指示条
  &::before {
    content: '';
    position: absolute;
    top: var(--axiom-base-sheet-indicator-top, 12px);
    left: 50%;
    transform: translateX(-50%);
    width: var(--axiom-base-sheet-indicator-width, 40px);
    height: var(--axiom-base-sheet-indicator-height, 4px);
    background: var(--axiom-base-sheet-handle-color);
    border-radius: var(--axiom-base-sheet-indicator-radius, 2px);
    opacity: var(--axiom-base-sheet-indicator-opacity, 0.6);
    z-index: 1;
  }
}

.axiom-base-sheet {
  @extend %axiom-base-sheet;
}

// 通用头部样式
%axiom-base-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--axiom-base-sheet-header-padding);
  border-bottom: 1px solid var(--axiom-base-sheet-header-border-color);
  background: var(--axiom-base-sheet-header-bg-color);
  backdrop-filter: var(--axiom-base-sheet-header-backdrop-filter);
  position: relative;

  .btn-clear {
    flex-shrink: 0;
  }

  .sheet-title {
    flex: 1;
    text-align: center;
    margin: 0 16px;
    
    :deep(.axiom-title__main) {
      margin: 0;
      font-size: var(--axiom-base-sheet-title-font-size);
      font-weight: var(--axiom-base-sheet-title-font-weight);
      color: var(--axiom-base-sheet-title-color);
    }
    
    :deep(.axiom-title__description) {
      display: none;
    }
  }

  .btn-close {
    flex-shrink: 0;
    
    :deep(.el-button) {
      padding: 8px;
      border-radius: 50%;
      width: 36px;
      height: 36px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
  }
}

// 通用搜索区域样式
%axiom-base-sheet__search-section {
  padding: var(--axiom-base-sheet-search-padding);
  border-bottom: 1px solid var(--axiom-base-sheet-search-border-color);
  
  .search-input {
    width: 100%;
    
    :deep(.el-input) {
      .el-input__inner {
        border-radius: var(--axiom-base-sheet-search-input-border-radius);
        border: 1px solid var(--axiom-base-sheet-search-input-border-color);
        background: var(--axiom-base-sheet-search-input-bg-color);
        color: var(--axiom-base-sheet-search-input-text-color);
        transition: all 0.3s ease;
        
        &:focus {
          border-color: var(--axiom-base-sheet-search-input-focus-border-color);
          background: var(--axiom-base-sheet-search-input-focus-bg-color);
          box-shadow: var(--axiom-base-sheet-search-input-focus-shadow);
        }
        
        &::placeholder {
          color: var(--axiom-base-sheet-search-input-placeholder-color);
        }
      }
      
      :deep(.el-input__prefix) {
        color: var(--axiom-base-sheet-search-input-prefix-color);
      }
    }
  }
}

// 通用快速选项样式
%axiom-base-sheet__quick-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--axiom-base-sheet-quick-options-gap);
  margin-bottom: var(--axiom-base-sheet-quick-options-margin-bottom);
}

%axiom-base-sheet__quick-option {
  padding: var(--axiom-base-sheet-quick-option-padding);
  border: 1px solid var(--axiom-base-sheet-quick-option-border-color);
  background: var(--axiom-base-sheet-quick-option-bg-color);
  color: var(--axiom-base-sheet-quick-option-text-color);
  font-size: var(--axiom-base-sheet-quick-option-font-size);
  border-radius: var(--axiom-base-sheet-quick-option-radius);
  cursor: pointer;
  transition: all 0.3s ease;
  
  &:hover {
    border-color: var(--axiom-base-sheet-quick-option-hover-border-color);
    background: var(--axiom-base-sheet-quick-option-hover-bg-color);
  }
  
  &.active {
    border-color: var(--axiom-base-sheet-quick-option-active-border-color);
    background: var(--axiom-base-sheet-quick-option-active-bg-color);
    color: var(--axiom-base-sheet-quick-option-active-text-color);
    font-weight: var(--axiom-base-sheet-quick-option-active-weight);
  }
}

// 通用内容区域样式
%axiom-base-sheet__content {
  padding: var(--axiom-base-sheet-content-padding);
  flex: 1;
  overflow-y: auto;
}

// 通用已选择区域样式
%axiom-base-sheet__selected-section {
  padding: var(--axiom-base-sheet-selected-padding);
  background: var(--axiom-base-sheet-selected-bg-color);
  border-bottom: 1px solid var(--axiom-base-sheet-selected-border-color);
}

%axiom-base-sheet__selected-title {
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--axiom-base-sheet-selected-title-color);
}

%axiom-base-sheet__selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

%axiom-base-sheet__selected-tag {
  background: var(--axiom-base-sheet-selected-tag-bg-color);
  border-color: var(--axiom-base-sheet-selected-tag-border-color);
  color: var(--axiom-base-sheet-selected-tag-text-color);
  border-radius: 16px;
  font-size: 13px;
  padding: 4px 12px;
}

%axiom-base-sheet__selected-tag-close {
  color: var(--axiom-base-sheet-selected-tag-close-color);
}

%axiom-base-sheet__selected-tag-close-hover {
  color: var(--axiom-base-sheet-selected-tag-close-hover-color);
  background: var(--axiom-base-sheet-selected-tag-close-hover-bg-color);
}


// 通用日期输入组样式
%axiom-base-sheet__date-input-group {
  display: flex;
  align-items: center;
  gap: 16px;
  
  .date-input-item {
    flex: 1;
  }
}

%axiom-base-sheet__sub-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--axiom-base-sheet-date-input-label-color);
}

// 通用时间输入样式
.sheet-time-inputs { // Using a regular class for extend, as it seems to be a specific layout block
  display: flex;
  align-items: center;
  
  .time-input {
    width: 100%;
    
    :deep(.el-input) {
      .el-input__inner {
        border-radius: 8px;
        border: 1px solid var(--axiom-base-sheet-time-input-border-color);
        background: var(--axiom-base-sheet-time-input-bg-color);
        color: var(--axiom-base-sheet-time-input-text-color);
        transition: all 0.3s ease;
        
        &:focus {
          border-color: var(--primary-color);
          box-shadow: var(--axiom-focus-ring-shadow);
        }
      }
    }
  }
}

// 通用页脚样式
%axiom-base-sheet__footer {
  padding: var(--axiom-base-sheet-footer-padding);
  background: var(--bg-color-secondary);
  backdrop-filter: blur(var(--backdrop-blur, 20px));
  border-top: var(--axiom-base-sheet-footer-border-top);
  box-shadow: var(--axiom-base-sheet-footer-shadow);
}

%axiom-base-sheet__footer-actions {
  display: flex;
  gap: var(--axiom-base-sheet-footer-actions-gap);
  
  .el-button {
    height: var(--axiom-base-sheet-footer-btn-height);
    border-radius: var(--axiom-base-sheet-footer-btn-radius);
    flex: 1;
  }
}

// 通用选项列表样式
%axiom-base-sheet__options-list {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--axiom-select-sheet-options-list-gap); // Should be a base-sheet variable

  // 自定义滚动条
  &::-webkit-scrollbar {
    width: var(--axiom-scrollbar-width, 6px);
  }
  
  &::-webkit-scrollbar-track {
    background: var(--bg-color-tertiary);
    border-radius: var(--axiom-scrollbar-thumb-border-radius, 3px);
  }
  
  &::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    opacity: 0.5;
    border-radius: var(--axiom-scrollbar-thumb-border-radius, 3px);
    
    &:hover {
      opacity: 0.8;
    }
  }
}

// Placeholder for classes that were in use but not defined in base
.axiom-base-sheet {
  &__header { @extend %axiom-base-sheet__header; }
  &__search { @extend %axiom-base-sheet__search-section; }
  &__content { @extend %axiom-base-sheet__content; }
  &__quick-options { @extend %axiom-base-sheet__quick-options; }
  &__quick-option { @extend %axiom-base-sheet__quick-option; }
  &__selected-section { @extend %axiom-base-sheet__selected-section; }
  &__selected-title { @extend %axiom-base-sheet__selected-title; }
  &__selected-tags { @extend %axiom-base-sheet__selected-tags; }
  &__selected-tag { @extend %axiom-base-sheet__selected-tag; }
  &__selected-tag-close { @extend %axiom-base-sheet__selected-tag-close; }
  &__selected-tag-close-hover { @extend %axiom-base-sheet__selected-tag-close-hover; }
  &__date-input-group { @extend %axiom-base-sheet__date-input-group; }
  &__sub-label { @extend %axiom-base-sheet__sub-label; }
  &__footer { @extend %axiom-base-sheet__footer; }
  &__footer-actions { @extend %axiom-base-sheet__footer-actions; }
  &__options-list { @extend %axiom-base-sheet__options-list; }
} 